/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package vn.com.fis.portal.vtcc.model;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;

import vn.com.fis.portal.vtcc.service.SampleEntryLocalServiceUtil;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.util.Date;

/**
 * @author loind
 */
public class SampleEntryClp extends BaseModelImpl<SampleEntry>
	implements SampleEntry {
	public SampleEntryClp() {
	}

	public Class<?> getModelClass() {
		return SampleEntry.class;
	}

	public String getModelClassName() {
		return SampleEntry.class.getName();
	}

	public long getPrimaryKey() {
		return _sampleId;
	}

	public void setPrimaryKey(long primaryKey) {
		setSampleId(primaryKey);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_sampleId);
	}

	public void setPrimaryKeyObj(Serializable primaryKeyObj) {
		setPrimaryKey(((Long)primaryKeyObj).longValue());
	}

	public long getSampleId() {
		return _sampleId;
	}

	public void setSampleId(long sampleId) {
		_sampleId = sampleId;
	}

	public String getScientificName() {
		return _scientificName;
	}

	public void setScientificName(String scientificName) {
		_scientificName = scientificName;
	}

	public String getSampleSynonym() {
		return _sampleSynonym;
	}

	public void setSampleSynonym(String sampleSynonym) {
		_sampleSynonym = sampleSynonym;
	}

	public int getECatalog() {
		return _eCatalog;
	}

	public void setECatalog(int eCatalog) {
		_eCatalog = eCatalog;
	}

	public String getSampleCode() {
		return _sampleCode;
	}

	public void setSampleCode(String sampleCode) {
		_sampleCode = sampleCode;
	}

	public String getCatalogYear() {
		return _catalogYear;
	}

	public void setCatalogYear(String catalogYear) {
		_catalogYear = catalogYear;
	}

	public String getOtherName() {
		return _otherName;
	}

	public void setOtherName(String otherName) {
		_otherName = otherName;
	}

	public String getSampleOtherCode() {
		return _sampleOtherCode;
	}

	public void setSampleOtherCode(String sampleOtherCode) {
		_sampleOtherCode = sampleOtherCode;
	}

	public String getSourceIsolation() {
		return _sourceIsolation;
	}

	public void setSourceIsolation(String sourceIsolation) {
		_sourceIsolation = sourceIsolation;
	}

	public String getHistory() {
		return _history;
	}

	public void setHistory(String history) {
		_history = history;
	}

	public int getSampleForeign() {
		return _sampleForeign;
	}

	public void setSampleForeign(int sampleForeign) {
		_sampleForeign = sampleForeign;
	}

	public int getDomestic() {
		return _domestic;
	}

	public void setDomestic(int domestic) {
		_domestic = domestic;
	}

	public int getDeposit() {
		return _deposit;
	}

	public void setDeposit(int deposit) {
		_deposit = deposit;
	}

	public String getIsolationMethod() {
		return _isolationMethod;
	}

	public void setIsolationMethod(String isolationMethod) {
		_isolationMethod = isolationMethod;
	}

	public String getIsolationTime() {
		return _isolationTime;
	}

	public void setIsolationTime(String isolationTime) {
		_isolationTime = isolationTime;
	}

	public String getDepositionTime() {
		return _depositionTime;
	}

	public void setDepositionTime(String depositionTime) {
		_depositionTime = depositionTime;
	}

	public String getIsolationPerson() {
		return _isolationPerson;
	}

	public void setIsolationPerson(String isolationPerson) {
		_isolationPerson = isolationPerson;
	}

	public String getFd() {
		return _fd;
	}

	public void setFd(String fd) {
		_fd = fd;
	}

	public String getDf() {
		return _df;
	}

	public void setDf(String df) {
		_df = df;
	}

	public String getSampleLN() {
		return _sampleLN;
	}

	public void setSampleLN(String sampleLN) {
		_sampleLN = sampleLN;
	}

	public String getCultivationMedium() {
		return _cultivationMedium;
	}

	public void setCultivationMedium(String cultivationMedium) {
		_cultivationMedium = cultivationMedium;
	}

	public String getCultivationTemperature() {
		return _cultivationTemperature;
	}

	public void setCultivationTemperature(String cultivationTemperature) {
		_cultivationTemperature = cultivationTemperature;
	}

	public String getPH() {
		return _pH;
	}

	public void setPH(String pH) {
		_pH = pH;
	}

	public Date getMostRecentCheckingDate() {
		return _mostRecentCheckingDate;
	}

	public void setMostRecentCheckingDate(Date mostRecentCheckingDate) {
		_mostRecentCheckingDate = mostRecentCheckingDate;
	}

	public String getSurvivability() {
		return _survivability;
	}

	public void setSurvivability(String survivability) {
		_survivability = survivability;
	}

	public int getTypeStrain() {
		return _typeStrain;
	}

	public void setTypeStrain(int typeStrain) {
		_typeStrain = typeStrain;
	}

	public int getNaturalStrain() {
		return _naturalStrain;
	}

	public void setNaturalStrain(int naturalStrain) {
		_naturalStrain = naturalStrain;
	}

	public int getMutatedStrain() {
		return _mutatedStrain;
	}

	public void setMutatedStrain(int mutatedStrain) {
		_mutatedStrain = mutatedStrain;
	}

	public int getProductionStrain() {
		return _productionStrain;
	}

	public void setProductionStrain(int productionStrain) {
		_productionStrain = productionStrain;
	}

	public String getCellMorphology() {
		return _cellMorphology;
	}

	public void setCellMorphology(String cellMorphology) {
		_cellMorphology = cellMorphology;
	}

	public String getCellPhoto() {
		return _cellPhoto;
	}

	public void setCellPhoto(String cellPhoto) {
		_cellPhoto = cellPhoto;
	}

	public String getColonyPhoto() {
		return _colonyPhoto;
	}

	public void setColonyPhoto(String colonyPhoto) {
		_colonyPhoto = colonyPhoto;
	}

	public String getSporePhoto() {
		return _sporePhoto;
	}

	public void setSporePhoto(String sporePhoto) {
		_sporePhoto = sporePhoto;
	}

	public String getSequences() {
		return _sequences;
	}

	public void setSequences(String sequences) {
		_sequences = sequences;
	}

	public String getGrowthCondition() {
		return _growthCondition;
	}

	public void setGrowthCondition(String growthCondition) {
		_growthCondition = growthCondition;
	}

	public String getQuinone() {
		return _quinone;
	}

	public void setQuinone(String quinone) {
		_quinone = quinone;
	}

	public String getGCContent() {
		return _GCContent;
	}

	public void setGCContent(String GCContent) {
		_GCContent = GCContent;
	}

	public String getOtherCharacteristics() {
		return _otherCharacteristics;
	}

	public void setOtherCharacteristics(String otherCharacteristics) {
		_otherCharacteristics = otherCharacteristics;
	}

	public String getApplications() {
		return _applications;
	}

	public void setApplications(String applications) {
		_applications = applications;
	}

	public String getSampleReferences() {
		return _sampleReferences;
	}

	public void setSampleReferences(String sampleReferences) {
		_sampleReferences = sampleReferences;
	}

	public Date getCreateDate() {
		return _createDate;
	}

	public void setCreateDate(Date createDate) {
		_createDate = createDate;
	}

	public Date getUpdateDate() {
		return _updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		_updateDate = updateDate;
	}

	public String getBiosafety() {
		return _biosafety;
	}

	public void setBiosafety(String biosafety) {
		_biosafety = biosafety;
	}

	public int getStatus() {
		return _status;
	}

	public void setStatus(int status) {
		_status = status;
	}

	public long getStrainId() {
		return _strainId;
	}

	public void setStrainId(long strainId) {
		_strainId = strainId;
	}

	public void persist() throws SystemException {
		if (this.isNew()) {
			SampleEntryLocalServiceUtil.addSampleEntry(this);
		}
		else {
			SampleEntryLocalServiceUtil.updateSampleEntry(this);
		}
	}

	@Override
	public SampleEntry toEscapedModel() {
		return (SampleEntry)Proxy.newProxyInstance(SampleEntry.class.getClassLoader(),
			new Class[] { SampleEntry.class }, new AutoEscapeBeanHandler(this));
	}

	@Override
	public Object clone() {
		SampleEntryClp clone = new SampleEntryClp();

		clone.setSampleId(getSampleId());
		clone.setScientificName(getScientificName());
		clone.setSampleSynonym(getSampleSynonym());
		clone.setECatalog(getECatalog());
		clone.setSampleCode(getSampleCode());
		clone.setCatalogYear(getCatalogYear());
		clone.setOtherName(getOtherName());
		clone.setSampleOtherCode(getSampleOtherCode());
		clone.setSourceIsolation(getSourceIsolation());
		clone.setHistory(getHistory());
		clone.setSampleForeign(getSampleForeign());
		clone.setDomestic(getDomestic());
		clone.setDeposit(getDeposit());
		clone.setIsolationMethod(getIsolationMethod());
		clone.setIsolationTime(getIsolationTime());
		clone.setDepositionTime(getDepositionTime());
		clone.setIsolationPerson(getIsolationPerson());
		clone.setFd(getFd());
		clone.setDf(getDf());
		clone.setSampleLN(getSampleLN());
		clone.setCultivationMedium(getCultivationMedium());
		clone.setCultivationTemperature(getCultivationTemperature());
		clone.setPH(getPH());
		clone.setMostRecentCheckingDate(getMostRecentCheckingDate());
		clone.setSurvivability(getSurvivability());
		clone.setTypeStrain(getTypeStrain());
		clone.setNaturalStrain(getNaturalStrain());
		clone.setMutatedStrain(getMutatedStrain());
		clone.setProductionStrain(getProductionStrain());
		clone.setCellMorphology(getCellMorphology());
		clone.setCellPhoto(getCellPhoto());
		clone.setColonyPhoto(getColonyPhoto());
		clone.setSporePhoto(getSporePhoto());
		clone.setSequences(getSequences());
		clone.setGrowthCondition(getGrowthCondition());
		clone.setQuinone(getQuinone());
		clone.setGCContent(getGCContent());
		clone.setOtherCharacteristics(getOtherCharacteristics());
		clone.setApplications(getApplications());
		clone.setSampleReferences(getSampleReferences());
		clone.setCreateDate(getCreateDate());
		clone.setUpdateDate(getUpdateDate());
		clone.setBiosafety(getBiosafety());
		clone.setStatus(getStatus());
		clone.setStrainId(getStrainId());

		return clone;
	}

	public int compareTo(SampleEntry sampleEntry) {
		int value = 0;

		value = getSampleCode().compareTo(sampleEntry.getSampleCode());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		SampleEntryClp sampleEntry = null;

		try {
			sampleEntry = (SampleEntryClp)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long primaryKey = sampleEntry.getPrimaryKey();

		if (getPrimaryKey() == primaryKey) {
			return true;
		}
		else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		return (int)getPrimaryKey();
	}

	@Override
	public String toString() {
		StringBundler sb = new StringBundler(91);

		sb.append("{sampleId=");
		sb.append(getSampleId());
		sb.append(", scientificName=");
		sb.append(getScientificName());
		sb.append(", sampleSynonym=");
		sb.append(getSampleSynonym());
		sb.append(", eCatalog=");
		sb.append(getECatalog());
		sb.append(", sampleCode=");
		sb.append(getSampleCode());
		sb.append(", catalogYear=");
		sb.append(getCatalogYear());
		sb.append(", otherName=");
		sb.append(getOtherName());
		sb.append(", sampleOtherCode=");
		sb.append(getSampleOtherCode());
		sb.append(", sourceIsolation=");
		sb.append(getSourceIsolation());
		sb.append(", history=");
		sb.append(getHistory());
		sb.append(", sampleForeign=");
		sb.append(getSampleForeign());
		sb.append(", domestic=");
		sb.append(getDomestic());
		sb.append(", deposit=");
		sb.append(getDeposit());
		sb.append(", isolationMethod=");
		sb.append(getIsolationMethod());
		sb.append(", isolationTime=");
		sb.append(getIsolationTime());
		sb.append(", depositionTime=");
		sb.append(getDepositionTime());
		sb.append(", isolationPerson=");
		sb.append(getIsolationPerson());
		sb.append(", fd=");
		sb.append(getFd());
		sb.append(", df=");
		sb.append(getDf());
		sb.append(", sampleLN=");
		sb.append(getSampleLN());
		sb.append(", cultivationMedium=");
		sb.append(getCultivationMedium());
		sb.append(", cultivationTemperature=");
		sb.append(getCultivationTemperature());
		sb.append(", pH=");
		sb.append(getPH());
		sb.append(", mostRecentCheckingDate=");
		sb.append(getMostRecentCheckingDate());
		sb.append(", survivability=");
		sb.append(getSurvivability());
		sb.append(", typeStrain=");
		sb.append(getTypeStrain());
		sb.append(", naturalStrain=");
		sb.append(getNaturalStrain());
		sb.append(", mutatedStrain=");
		sb.append(getMutatedStrain());
		sb.append(", productionStrain=");
		sb.append(getProductionStrain());
		sb.append(", cellMorphology=");
		sb.append(getCellMorphology());
		sb.append(", cellPhoto=");
		sb.append(getCellPhoto());
		sb.append(", colonyPhoto=");
		sb.append(getColonyPhoto());
		sb.append(", sporePhoto=");
		sb.append(getSporePhoto());
		sb.append(", sequences=");
		sb.append(getSequences());
		sb.append(", growthCondition=");
		sb.append(getGrowthCondition());
		sb.append(", quinone=");
		sb.append(getQuinone());
		sb.append(", GCContent=");
		sb.append(getGCContent());
		sb.append(", otherCharacteristics=");
		sb.append(getOtherCharacteristics());
		sb.append(", applications=");
		sb.append(getApplications());
		sb.append(", sampleReferences=");
		sb.append(getSampleReferences());
		sb.append(", createDate=");
		sb.append(getCreateDate());
		sb.append(", updateDate=");
		sb.append(getUpdateDate());
		sb.append(", biosafety=");
		sb.append(getBiosafety());
		sb.append(", status=");
		sb.append(getStatus());
		sb.append(", strainId=");
		sb.append(getStrainId());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(139);

		sb.append("<model><model-name>");
		sb.append("vn.com.fis.portal.vtcc.model.SampleEntry");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>sampleId</column-name><column-value><![CDATA[");
		sb.append(getSampleId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>scientificName</column-name><column-value><![CDATA[");
		sb.append(getScientificName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sampleSynonym</column-name><column-value><![CDATA[");
		sb.append(getSampleSynonym());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>eCatalog</column-name><column-value><![CDATA[");
		sb.append(getECatalog());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sampleCode</column-name><column-value><![CDATA[");
		sb.append(getSampleCode());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>catalogYear</column-name><column-value><![CDATA[");
		sb.append(getCatalogYear());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>otherName</column-name><column-value><![CDATA[");
		sb.append(getOtherName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sampleOtherCode</column-name><column-value><![CDATA[");
		sb.append(getSampleOtherCode());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sourceIsolation</column-name><column-value><![CDATA[");
		sb.append(getSourceIsolation());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>history</column-name><column-value><![CDATA[");
		sb.append(getHistory());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sampleForeign</column-name><column-value><![CDATA[");
		sb.append(getSampleForeign());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>domestic</column-name><column-value><![CDATA[");
		sb.append(getDomestic());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>deposit</column-name><column-value><![CDATA[");
		sb.append(getDeposit());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>isolationMethod</column-name><column-value><![CDATA[");
		sb.append(getIsolationMethod());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>isolationTime</column-name><column-value><![CDATA[");
		sb.append(getIsolationTime());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>depositionTime</column-name><column-value><![CDATA[");
		sb.append(getDepositionTime());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>isolationPerson</column-name><column-value><![CDATA[");
		sb.append(getIsolationPerson());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>fd</column-name><column-value><![CDATA[");
		sb.append(getFd());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>df</column-name><column-value><![CDATA[");
		sb.append(getDf());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sampleLN</column-name><column-value><![CDATA[");
		sb.append(getSampleLN());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>cultivationMedium</column-name><column-value><![CDATA[");
		sb.append(getCultivationMedium());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>cultivationTemperature</column-name><column-value><![CDATA[");
		sb.append(getCultivationTemperature());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>pH</column-name><column-value><![CDATA[");
		sb.append(getPH());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>mostRecentCheckingDate</column-name><column-value><![CDATA[");
		sb.append(getMostRecentCheckingDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>survivability</column-name><column-value><![CDATA[");
		sb.append(getSurvivability());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>typeStrain</column-name><column-value><![CDATA[");
		sb.append(getTypeStrain());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>naturalStrain</column-name><column-value><![CDATA[");
		sb.append(getNaturalStrain());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>mutatedStrain</column-name><column-value><![CDATA[");
		sb.append(getMutatedStrain());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>productionStrain</column-name><column-value><![CDATA[");
		sb.append(getProductionStrain());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>cellMorphology</column-name><column-value><![CDATA[");
		sb.append(getCellMorphology());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>cellPhoto</column-name><column-value><![CDATA[");
		sb.append(getCellPhoto());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>colonyPhoto</column-name><column-value><![CDATA[");
		sb.append(getColonyPhoto());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sporePhoto</column-name><column-value><![CDATA[");
		sb.append(getSporePhoto());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sequences</column-name><column-value><![CDATA[");
		sb.append(getSequences());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>growthCondition</column-name><column-value><![CDATA[");
		sb.append(getGrowthCondition());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>quinone</column-name><column-value><![CDATA[");
		sb.append(getQuinone());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>GCContent</column-name><column-value><![CDATA[");
		sb.append(getGCContent());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>otherCharacteristics</column-name><column-value><![CDATA[");
		sb.append(getOtherCharacteristics());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>applications</column-name><column-value><![CDATA[");
		sb.append(getApplications());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>sampleReferences</column-name><column-value><![CDATA[");
		sb.append(getSampleReferences());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>createDate</column-name><column-value><![CDATA[");
		sb.append(getCreateDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>updateDate</column-name><column-value><![CDATA[");
		sb.append(getUpdateDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>biosafety</column-name><column-value><![CDATA[");
		sb.append(getBiosafety());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>status</column-name><column-value><![CDATA[");
		sb.append(getStatus());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>strainId</column-name><column-value><![CDATA[");
		sb.append(getStrainId());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _sampleId;
	private String _scientificName;
	private String _sampleSynonym;
	private int _eCatalog;
	private String _sampleCode;
	private String _catalogYear;
	private String _otherName;
	private String _sampleOtherCode;
	private String _sourceIsolation;
	private String _history;
	private int _sampleForeign;
	private int _domestic;
	private int _deposit;
	private String _isolationMethod;
	private String _isolationTime;
	private String _depositionTime;
	private String _isolationPerson;
	private String _fd;
	private String _df;
	private String _sampleLN;
	private String _cultivationMedium;
	private String _cultivationTemperature;
	private String _pH;
	private Date _mostRecentCheckingDate;
	private String _survivability;
	private int _typeStrain;
	private int _naturalStrain;
	private int _mutatedStrain;
	private int _productionStrain;
	private String _cellMorphology;
	private String _cellPhoto;
	private String _colonyPhoto;
	private String _sporePhoto;
	private String _sequences;
	private String _growthCondition;
	private String _quinone;
	private String _GCContent;
	private String _otherCharacteristics;
	private String _applications;
	private String _sampleReferences;
	private Date _createDate;
	private Date _updateDate;
	private String _biosafety;
	private int _status;
	private long _strainId;
}